package demo1;

public class Dog extends Animal{

    public String color;

    static {
        System.out.println("Dog的静态代码块被执行...");
    }

    {
        System.out.println("Dog的实例代码块被执行");
    }

    public Dog(String name, int age, String color){
        super(name, age);
        this.color = color;
        System.out.println("带两个参数的构造方法被执行...");
    }

    public Dog(){
        super();
        System.out.println("不带参数的构造方法被执行...");
    }

    public void bark(){
        System.out.println(this.name + "正在旺旺叫...");
    }
}
